import java.util.Arrays;

public class Student implements Comparable{
    String name;
    int score;
    @Override
    public int compareTo(Object o) {
        Student s=(Student)o;
        return this.score-s.score;
    }
    @Override
    public String toString() {
        return "["+this.name+"."+this.score+"]";
    }

    public Student(String name, int score) {
        this.name = name;
        this.score = score;
    }

    public static void main(String[] args) {
        Student[] stu=new Student[]{new Student("张三",65),new Student("李四",23),new Student("王五",92)};
        System.out.println(Arrays.toString(stu));
        Arrays.sort(stu);
        System.out.println(Arrays.toString(stu));
    }
}
